import java.util.HashSet;
import java.util.Set;

/**
 * @author LKQ
 * @date 2022/2/2 15:52
 * @description
 */
public class Solution {
    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] nums = {2, 3, 1, 0, 2, 5, 3};
        solution.findRepeatNumber(nums);
    }
    public int findRepeatNumber(int[] nums) {
        Set<Integer> set = new HashSet<>();
        int ans = 0;
        for (int num : nums) {
            if (!set.add(num)) {
                ans = num;
                break;
            }
        }
        return ans;
    }
}
